package com.qingfeng.qfcms.service.impl;

import com.qingfeng.qfcms.dao.RoleDao;
import com.qingfeng.qfcms.domin.Role;
import com.qingfeng.qfcms.page.Page;
import com.qingfeng.qfcms.service.RoleService;
import com.qingfeng.qfcms.utils.DateUtil;
import com.qingfeng.qfcms.utils.uuuidUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 *
 * Created by User on 2016/7/20.
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleDao roleDao;
    public List<Role> findPage(Page page) {
        return roleDao.findPage(page);
    }

    public List<Role> find(Map paraMap) {
        return null;
    }

    public List<Role> list(Map paraMap) {
        return null;
    }

    public Role get(Serializable id) {
        return roleDao.get(id);
    }

    public void insert(Role entity) {
        entity.setROLE_ID(uuuidUtils.toUUUID());
        entity.setCreate_time(DateUtil.dateToString(new Date(),"yyyy-MM-dd HH:mm:ss"));
        roleDao.insert(entity);
    }

    public void update(Role entity) {
        entity.setCreate_time(DateUtil.dateToString(new Date(),"yyyy-MM-dd HH:mm:ss"));
        roleDao.update(entity);

    }

    public void deleteById(Serializable id) {
        roleDao.deleteById(id);
    }

    public void delete(Serializable[] ids) {
       roleDao.delete(ids);
    }
}
